import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "Main",
    component: () => import("../views/Main.vue"),
    redirect: "/home",
    children: [
      {
        path: "/home",
        name: "home",
        component: () => import("../views/home"),
      },
      {
        path: "/reader",
        name: "reader",
        component: () => import("../views/user/reader"),
      },
      {
        path: "/manager",
        name: "manager",
        component: () => import("../views/user/manager"),
      },
      {
        path: "/books",
        name: "books",
        component: () => import("../views/book/books"),
      },
      {
        path: "/test",
        name: "test",
        component: () => import("../views/book/test"),
      }
    ]
  },
  {
    path: "/login",
    name: "login",
    component: () => import("../views/login"),
  },
];

const router = new VueRouter({
  mode: "history",
  routes,
});

export default router;
